package io.renren.modules.sys.entity.vo;

import io.renren.common.utils.DateUtils;
import lombok.Data;
import org.apache.commons.lang.StringUtils;

import java.util.Date;

/**
 * @author 葛傲锋 by 2020/12/11
 */
@Data
public class SysPatientVisitQueryListVO {

    private Integer page;

    private Integer limit;

    private String patientName;

    private String startTime;

    private String endTime;

    /**
     * 时间初始化, 如果时间为空,就取当前时间一星期内赋值
     */
    public void timeProcess() {
        this.startTime = StringUtils.isEmpty(this.startTime) ? DateUtils.format(DateUtils.addDateDays(new Date(), -30), DateUtils.DATE_TIME_PATTERN) : this.startTime;
        this.endTime = StringUtils.isEmpty(this.endTime) ? DateUtils.format(new Date(), DateUtils.DATE_TIME_PATTERN) : this.endTime;
    }
}
